import { defineStore } from "pinia";

export const useDesignStore = defineStore("design", {
  state: () => {
    return {
      dyncComps: {}
    }
  },
  getters: {
    getDyncComps(state) {
      return state.dyncComps;
    }
  },
  actions: {
    setDyncComps(comp) {
      const lib = comp?.comp_lib;
      const name = comp?.comp_name;
      if(!lib || !name) return;
      this.dyncComps[ `${ lib }-${ name }` ] = comp;
    }
  }
})
